/**
 * Copyright (c) 2010, QinJian
 * All rights reserved.
 */
package com.q.course.entity.arrange;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;

import org.codehaus.jackson.annotate.JsonIgnore;


import com.q.course.entity.category.Category;
import com.q.course.entity.classes.Classes;
import com.q.course.entity.user.BaseEntity;
import com.q.course.entity.user.User;

/**
 * @author 覃健,Email:j411@qq.com
 *
 */
@Entity
@Table( name = "q_arrange" )
public class Arrange extends BaseEntity {

	@NotNull
	private Long classesId;//班
	private Classes classes;
	@NotNull
	private Long courseId;
	private Category course;
	private Integer classHour;
	private Long teacherId;
	private User teacher;
	private Date startTime;
	private Date endTime;
	/**
	 * 每次排课的课时数
	 */
	private Integer number;
	@NotNull
	private Long placeId;
	private Category place;
	
	//非持久化
	private Integer classHourSum;
	private String arrangeLaw;
	@Transient
	@JsonIgnore
	public String getArrangeLaw() {
		return arrangeLaw;
	}
	public void setArrangeLaw(String arrangeLaw) {
		this.arrangeLaw = arrangeLaw;
	}
	@Transient
	@JsonIgnore
	public Integer getClassHourSum() {
		return classHourSum;
	}
	
	public void setClassHourSum(Integer classHourSum) {
		this.classHourSum = classHourSum;
	}
	public Integer getNumber() {
		return number;
	}
	public void setNumber(Integer number) {
		this.number = number;
	}
	@Column( name="course_id" )
	public Long getCourseId() {
		return courseId;
	}
	public void setCourseId(Long courseId) {
		this.courseId = courseId;
	}
	@ManyToOne
	@JoinColumn( name="course_id" , insertable = false , updatable = false )
	public Category getCourse() {
		return course;
	}
	public void setCourse(Category course) {
		this.course = course;
	}
	@Column( name="classes_id" )
	public Long getClassesId() {
		return classesId;
	}
	public void setClassesId(Long classesId) {
		this.classesId = classesId;
	}
	
	@ManyToOne
	@JoinColumn( name="classes_id" , insertable = false , updatable = false )
	public Classes getClasses() {
		return classes;
	}
	public void setClasses(Classes classes) {
		this.classes = classes;
	}
	
	public Integer getClassHour() {
		return classHour;
	}
	public void setClassHour(Integer classHour) {
		this.classHour = classHour;
	}
	
	@Column( name="teacher_id" )
	public Long getTeacherId() {
		return teacherId;
	}
	public void setTeacherId(Long teacherId) {
		this.teacherId = teacherId;
	}
	
	@ManyToOne
	@JoinColumn( name="teacher_id" , insertable = false , updatable = false )
	public User getTeacher() {
		return teacher;
	}
	public void setTeacher(User teacher) {
		this.teacher = teacher;
	}
	public Date getStartTime() {
		return startTime;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	public Date getEndTime() {
		return endTime;
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	@Column( name="place_id" )
	public Long getPlaceId() {
		return placeId;
	}
	public void setPlaceId(Long placeId) {
		this.placeId = placeId;
	}
	@ManyToOne
	@JoinColumn( name="place_id" , insertable = false , updatable = false )
	public Category getPlace() {
		return place;
	}
	public void setPlace(Category place) {
		this.place = place;
	}
	
}
